<?php
namespace Controller;

use Gregwar\Captcha\CaptchaBuilder;
use Hoa\Registry\Registry;
use Library\Log;
use Library\View;


/**
 * CaptchaController
 * @author los_gsy
 */
class CaptchaController extends BaseController {
	/**
	 * 构造函数
	 */
	public function __construct() {
		parent::__construct();
	}


	/**
	 * test
	 */
	public function test() {
		echo __METHOD__, '<br />';
	}


	/**
	 * captcha
	 */
	public function captcha() {
// 		header('Content-type: image/jpeg');
		$builder = new CaptchaBuilder;
		$builder->build();
// 		$builder->output();
		$src = $builder->inline();
		$data = [];
		$data['src'] = $src;
		View::display('Captcha/captcha', $data);
	}


}